﻿using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace MVVM.NotifyPropertyChanged.ViewModels
{
    /// <summary>
    /// 需要通知属性
    /// </summary>
    public class NotifyProperty : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged([CallerMemberName] String propertyName = "")
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
